<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>京选友惠</title>
<meta name="viewport"
	content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/static/mobile/index/css/aui.2.0.css">
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/static/mobile/index/css/aui-slide.css">
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/static/mobile/index/css/common.css">
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/static/mobile/index/css/index.css">
</head>
<body>
	<!-- -生钱通知- -->
	<div class="noticemain" id="luanbo">
		<ul class="samenotice-ul" id="msgcount" style="height:2.5rem">

		</ul>
	</div>
</body>
<script
	src="<%=request.getContextPath()%>/static/js/jquery-1.9.1.min.js"></script>
<script
	src="<%=request.getContextPath()%>/static/mobile/index/js/scroll.js"></script>
<%-- <script src="<%=request.getContextPath()%>/static/mobile/index/js/index.js"></script>
 --%>
<script>
	$(function() {

		$
				.ajax({
					url : "http://develop.jhjvip.cn:8080/mall/mobile/index/getMakeMoneyList",
					type : 'get',
					dataType : 'json',
					data : {},
					success : function(response) {
						if (response.code == '10000') {
							var list = response.data;

							for (var i = 0; i < list.length; i++) {
								addMsg(list[i]);

							}
						}
					}
				});
	});
	function addMsg(data) {
		var headImg = data.userHeadImg;
		var name = data.userNickName;
		var money = data.amount;
		var time = data.createTime;
		if(name.length>6){
			name=name.substring(0,6);
		}
		var msg =  name + "惠生钱刚刚收益了" + money + "元！";
		$("#msgcount")
				.append(
						'<li class="samenotice-li aui-clearfix">'
								
								+ '<div class="noticeimg"><img  src='+headImg+'></img></div>'
								+ '<div class="noticeinfo">'
								+'<span class="newpspan">' +msg+'</span>'
								+  '</div>' 
								//'<div class="returnbut"><i></i></div>'+
								 + '</li>')
	}
</script>
<script type="text/javascript">
var odiv=document.getElementById("luanbo");
var oul=document.getElementById("msgcount");
var oli=document.getElementById("msgcount").getElementsByTagName("li");
var iNow=0;
function move(obj,tg){ //运动框架
clearInterval(dt);
var dt=setInterval(function(){
 var speed=2;
 if(tg-obj.scrollTop<speed){
  tg=obj.scrollTop;
  clearInterval(dt);
 }else{
  obj.scrollTop+=speed;
 }
},30);
}
oul.innerHTML+=oul.innerHTML;
function star(){
clearInterval(tm);
var tm=setInterval(function(){
 iNow++;
 if(odiv.scrollTop>=(oli[0].offsetHeight*oli.length)/2){
  odiv.scrollTop=0;
  iNow=0;
 }else{
 var get=oli[0].offsetHeight*iNow;
 move(odiv,get); //运动框架
 }
},4000);
}
star();  
</script>
</html>